#{extends 'main.html' /} #{set title:'ActionItemView' /}
<head>



<script type="text/javascript">
	$(function() {
		$('#firstForm').hide();
	});
</script>

<script type="text/javascript">
	function showTextBox() {
		$('#firstForm').show(1000);
	};
</script>

<script type="text/javascript">
	function volunteerOnTheActionItem() {
		$.getJSON('@{ActionPlanController.volunteerToWorkOnActionItem()}', {
			'ideaDeveloperId' : ${ideaDeveloperId},
			'actionItemId' : ${actionItem.id},
			'body' : document.getElementById("textBox").value
		}, function(data) {
			$('#one').jGrowl(data.res);
		});
		$('#firstForm').hide(1000);
	};
</script>




</head>

<body>
	<p></p>
	<p>
		<b>Action Item Body: </b>${actionItem.body}
	</p>

	<p>
		<b>Action Item Start Date: </b>${actionItem.startDate.getDay()}-${actionItem.startDate.getMonth()}-${actionItem.startDate.getYear()+1900}

	</p>
	<p>
		<b>Action Item End Date: </b>${actionItem.endDate.getDay()}-${actionItem.endDate.getMonth()}-${actionItem.endDate.getYear()+1900}
	</p>

	#{list items:requests, as:'requests'}
	<li>${requests.dev.username} sent the following request
		"${requests.body}" <input id=${requests.id} type="button"
		value="accept" /> <input id=${requests.id}+"1" type="button"
		value="reject" /></li> #{/list}


	<input id="Volunteer" type="button" value="Volunteer"
		onclick="javascript:showTextBox()" />

	<form id="firstForm" name="input" action="#" method="get">
		<p>
			<b>Request Body</b><input type="text" id="textBox" size="50" value=""
				name="search" />
		</p>

		<input type="button" value="Submit"
			onclick="javascript:volunteerOnTheActionItem()" />
	</form>


	<p>
		<input id=${actionItem.id} type="button" value="Related Entities"
			onclick="location.href='@{ActionPlanController.relatedEntities(actionItem.id)}'" />
		<input id=${actionItem.id} type="button" value="Related Topics"
			onclick="location.href='@{ActionPlanController.relatedTopics(actionItem.id)}'" />
		<input id=${actionItem.id} type="button" value="Related Tags"
			onclick="location.href='@{ActionPlanController.relatedTags(actionItem.id)}'" />
	</p>
	<p>
		<input id=${actionItem.id} type="button" value="Relate To Entities"
			onclick="location.href='@{ActionPlanController.relateToEntities(actionItem.id)}'" />
		<input id=${actionItem.id} type="button" value="Relate To Topics"
			onclick="location.href='@{ActionPlanController.relateToTopics(actionItem.id)}'" />
		<input id=${actionItem.id} type="button" value="Relate To Tags"
			onclick="location.href='@{ActionPlanController.relateToTags(actionItem.id)}'" />
	</p>
</body>